const connection = require('../db/mysql')

class RechargeService {
  async recharge (amount, orderNo, userId, status) {
    const statement = "INSERT INTO recharge(amount, orderNo, userId, status) VALUES(?, ?, ?, ?);"
    console.log(`INSERT INTO recharge(amount, orderNo, userId, status) VALUES(${amount}, '${orderNo}', ${userId}, ${status});`)
    const [result] = await connection.execute(statement, [amount, orderNo, userId, status])
    return result;
  }
}

module.exports = new RechargeService()